ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

CSS Format

by mutian ALL

CSS Formatting for Sublime Text

Labels formatting, css

Details

Installs

  • Total 177K
  • Win 120K
  • Mac 41K
  • Linux 16K
May 16 May 15 May 14 May 13 May 12 May 11 May 10 May 9 May 8 May 7 May 6 May 5 May 4 May 3 May 2 May 1 Apr 30 Apr 29 Apr 28 Apr 27 Apr 26 Apr 25 Apr 24 Apr 23 Apr 22 Apr 21 Apr 20 Apr 19 Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1
Windows 2 2 3 7 0 0 3 2 5 3 4 5 3 2 1 3 3 2 3 3 2 6 2 2 1 6 2 6 5 6 5 4 3 4 1 4 1 7 2 4 0 1 6 0 5 5
Mac 0 1 2 4 1 0 0 3 0 4 1 1 3 3 1 1 2 1 1 0 2 1 5 5 4 1 0 0 2 2 2 2 0 0 1 4 0 2 1 3 0 1 3 1 2 1
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 1 3 0 1 1 0 0 1 0 0 0 2 1 0 1 0 2 0 1 0 1 0 3 0 0 1 2 0 0 0 1 2 2
0246810May 16May 13May 10May 7May 4May 1Apr 28Apr 25Apr 22Apr 19Apr 16Apr 13Apr 10Apr 7Apr 4Apr 1May 16 Linux: 0 Mac: 0 Windows: 2May 15 Linux: 0 Mac: 1 Windows: 2May 14 Linux: 0 Mac: 2 Windows: 3May 13 Linux: 0 Mac: 4 Windows: 7May 12 Linux: 0 Mac: 1 Windows: 0May 11 Linux: 0 Mac: 0 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 3May 9 Linux: 0 Mac: 3 Windows: 2May 8 Linux: 0 Mac: 0 Windows: 5May 7 Linux: 0 Mac: 4 Windows: 3May 6 Linux: 0 Mac: 1 Windows: 4May 5 Linux: 0 Mac: 1 Windows: 5May 4 Linux: 0 Mac: 3 Windows: 3May 3 Linux: 1 Mac: 3 Windows: 2May 2 Linux: 3 Mac: 1 Windows: 1May 1 Linux: 0 Mac: 1 Windows: 3Apr 30 Linux: 1 Mac: 2 Windows: 3Apr 29 Linux: 1 Mac: 1 Windows: 2Apr 28 Linux: 0 Mac: 1 Windows: 3Apr 27 Linux: 0 Mac: 0 Windows: 3Apr 26 Linux: 1 Mac: 2 Windows: 2Apr 25 Linux: 0 Mac: 1 Windows: 6Apr 24 Linux: 0 Mac: 5 Windows: 2Apr 23 Linux: 0 Mac: 5 Windows: 2Apr 22 Linux: 2 Mac: 4 Windows: 1Apr 21 Linux: 1 Mac: 1 Windows: 6Apr 20 Linux: 0 Mac: 0 Windows: 2Apr 19 Linux: 1 Mac: 0 Windows: 6Apr 18 Linux: 0 Mac: 2 Windows: 5Apr 17 Linux: 2 Mac: 2 Windows: 6Apr 16 Linux: 0 Mac: 2 Windows: 5Apr 15 Linux: 1 Mac: 2 Windows: 4Apr 14 Linux: 0 Mac: 0 Windows: 3Apr 13 Linux: 1 Mac: 0 Windows: 4Apr 12 Linux: 0 Mac: 1 Windows: 1Apr 11 Linux: 3 Mac: 4 Windows: 4Apr 10 Linux: 0 Mac: 0 Windows: 1Apr 9 Linux: 0 Mac: 2 Windows: 7Apr 8 Linux: 1 Mac: 1 Windows: 2Apr 7 Linux: 2 Mac: 3 Windows: 4Apr 6 Linux: 0 Mac: 0 Windows: 0Apr 5 Linux: 0 Mac: 1 Windows: 1Apr 4 Linux: 0 Mac: 3 Windows: 6Apr 3 Linux: 1 Mac: 1 Windows: 0Apr 2 Linux: 2 Mac: 2 Windows: 5Apr 1 Linux: 2 Mac: 1 Windows: 5May 16 Linux: 0 Mac: 0 Windows: 2May 15 Linux: 0 Mac: 1 Windows: 2May 14 Linux: 0 Mac: 2 Windows: 3May 13 Linux: 0 Mac: 4 Windows: 7May 12 Linux: 0 Mac: 1 Windows: 0May 11 Linux: 0 Mac: 0 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 3May 9 Linux: 0 Mac: 3 Windows: 2May 8 Linux: 0 Mac: 0 Windows: 5May 7 Linux: 0 Mac: 4 Windows: 3May 6 Linux: 0 Mac: 1 Windows: 4May 5 Linux: 0 Mac: 1 Windows: 5May 4 Linux: 0 Mac: 3 Windows: 3May 3 Linux: 1 Mac: 3 Windows: 2May 2 Linux: 3 Mac: 1 Windows: 1May 1 Linux: 0 Mac: 1 Windows: 3Apr 30 Linux: 1 Mac: 2 Windows: 3Apr 29 Linux: 1 Mac: 1 Windows: 2Apr 28 Linux: 0 Mac: 1 Windows: 3Apr 27 Linux: 0 Mac: 0 Windows: 3Apr 26 Linux: 1 Mac: 2 Windows: 2Apr 25 Linux: 0 Mac: 1 Windows: 6Apr 24 Linux: 0 Mac: 5 Windows: 2Apr 23 Linux: 0 Mac: 5 Windows: 2Apr 22 Linux: 2 Mac: 4 Windows: 1Apr 21 Linux: 1 Mac: 1 Windows: 6Apr 20 Linux: 0 Mac: 0 Windows: 2Apr 19 Linux: 1 Mac: 0 Windows: 6Apr 18 Linux: 0 Mac: 2 Windows: 5Apr 17 Linux: 2 Mac: 2 Windows: 6Apr 16 Linux: 0 Mac: 2 Windows: 5Apr 15 Linux: 1 Mac: 2 Windows: 4Apr 14 Linux: 0 Mac: 0 Windows: 3Apr 13 Linux: 1 Mac: 0 Windows: 4Apr 12 Linux: 0 Mac: 1 Windows: 1Apr 11 Linux: 3 Mac: 4 Windows: 4Apr 10 Linux: 0 Mac: 0 Windows: 1Apr 9 Linux: 0 Mac: 2 Windows: 7Apr 8 Linux: 1 Mac: 1 Windows: 2Apr 7 Linux: 2 Mac: 3 Windows: 4Apr 6 Linux: 0 Mac: 0 Windows: 0Apr 5 Linux: 0 Mac: 1 Windows: 1Apr 4 Linux: 0 Mac: 3 Windows: 6Apr 3 Linux: 1 Mac: 1 Windows: 0Apr 2 Linux: 2 Mac: 2 Windows: 5Apr 1 Linux: 2 Mac: 1 Windows: 5May 16 Linux: 0 Mac: 0 Windows: 2May 15 Linux: 0 Mac: 1 Windows: 2May 14 Linux: 0 Mac: 2 Windows: 3May 13 Linux: 0 Mac: 4 Windows: 7May 12 Linux: 0 Mac: 1 Windows: 0May 11 Linux: 0 Mac: 0 Windows: 0May 10 Linux: 0 Mac: 0 Windows: 3May 9 Linux: 0 Mac: 3 Windows: 2May 8 Linux: 0 Mac: 0 Windows: 5May 7 Linux: 0 Mac: 4 Windows: 3May 6 Linux: 0 Mac: 1 Windows: 4May 5 Linux: 0 Mac: 1 Windows: 5May 4 Linux: 0 Mac: 3 Windows: 3May 3 Linux: 1 Mac: 3 Windows: 2May 2 Linux: 3 Mac: 1 Windows: 1May 1 Linux: 0 Mac: 1 Windows: 3Apr 30 Linux: 1 Mac: 2 Windows: 3Apr 29 Linux: 1 Mac: 1 Windows: 2Apr 28 Linux: 0 Mac: 1 Windows: 3Apr 27 Linux: 0 Mac: 0 Windows: 3Apr 26 Linux: 1 Mac: 2 Windows: 2Apr 25 Linux: 0 Mac: 1 Windows: 6Apr 24 Linux: 0 Mac: 5 Windows: 2Apr 23 Linux: 0 Mac: 5 Windows: 2Apr 22 Linux: 2 Mac: 4 Windows: 1Apr 21 Linux: 1 Mac: 1 Windows: 6Apr 20 Linux: 0 Mac: 0 Windows: 2Apr 19 Linux: 1 Mac: 0 Windows: 6Apr 18 Linux: 0 Mac: 2 Windows: 5Apr 17 Linux: 2 Mac: 2 Windows: 6Apr 16 Linux: 0 Mac: 2 Windows: 5Apr 15 Linux: 1 Mac: 2 Windows: 4Apr 14 Linux: 0 Mac: 0 Windows: 3Apr 13 Linux: 1 Mac: 0 Windows: 4Apr 12 Linux: 0 Mac: 1 Windows: 1Apr 11 Linux: 3 Mac: 4 Windows: 4Apr 10 Linux: 0 Mac: 0 Windows: 1Apr 9 Linux: 0 Mac: 2 Windows: 7Apr 8 Linux: 1 Mac: 1 Windows: 2Apr 7 Linux: 2 Mac: 3 Windows: 4Apr 6 Linux: 0 Mac: 0 Windows: 0Apr 5 Linux: 0 Mac: 1 Windows: 1Apr 4 Linux: 0 Mac: 3 Windows: 6Apr 3 Linux: 1 Mac: 1 Windows: 0Apr 2 Linux: 2 Mac: 2 Windows: 5Apr 1 Linux: 2 Mac: 1 Windows: 5

Readme

Source
raw.​githubusercontent.​com

CSS Formatter for Sublime Text

Description

CSS Format is a CSS formatting plugin for Sublime Text, you can convert CSS/SASS/SCSS/LESS code to Expanded, Compact or Compressed format. CSS Format is just only a formatter, do not supports grammar check and auto correct feature.

Example:

  • Expanded:

    body {
        background: #fff;
        font: 12px/2em Arial, Helvetica, sans-serif;
    }
    ol, ul, li {
        margin: 0;
        padding: 0;
    }
    a {
        color: rgba(65, 131, 196, 0.8);
    }
    
  • Expanded (Break Selectors):

    body {
        background: #fff;
        font: 12px/2em Arial, Helvetica, sans-serif;
    }
    
    ol,
    ul,
    li {
        margin: 0;
        padding: 0;
    }
    
    a {
        color: rgba(65, 131, 196, 0.8);
    }
    
  • Compact:

    body { background: #fff; font: 12px/2em Arial, Helvetica, sans-serif; }
    ol, ul, li { margin: 0; padding: 0; }
    a { color: rgba(65, 131, 196, 0.8); }
    
  • Compact (No Spaces):

    body{background:#fff;font:12px/2em Arial,Helvetica,sans-serif;}
    ol,ul,li{margin:0;padding:0;}
    a{color:rgba(65,131,196,0.8);}
    
  • Compact (Break Selectors):

    body { background: #fff; font: 12px/2em Arial, Helvetica, sans-serif; }
    ol,
    ul,
    li { margin: 0; padding: 0; }
    a { color: rgba(65, 131, 196, 0.8); }
    
  • Compact (Break Selectors, No Spaces):

    body{background:#fff;font:12px/2em Arial,Helvetica,sans-serif;}
    ol,
    ul,
    li{margin:0;padding:0;}
    a{color:rgba(65,131,196,0.8);}
    
  • Compressed:

    body{background:#fff;font:12px/2em Arial,Helvetica,sans-serif}ol,ul,li{margin:0;padding:0}a{color:rgba(65,131,196,0.8)}
    

Installation

OPTION 1 - with Package Control (recommended)

The easiest way to install this package is through Package Control.

  1. Install Package Control, follow instructions on the website.

  2. Open command panel: Ctrl+Shift+P (Linux/Windows) or Cmd+Shift+P (OS X) and select Package Control: Install Package.

  3. When packages list appears, type CSS Format and select it.

OPTION 2 - with Git

Clone the repository in your Sublime Text “Packages” directory:

git clone git://github.com/mutian/Sublime-CSS-Format.git "CSS Format"

You can find your “Packages” inside the following directories:

  • OS X: ~/Library/Application Support/Sublime Text 2/Packages/

  • Windows: %APPDATA%/Sublime Text 2/Packages/

  • Linux: ~/.Sublime Text 2/Packages/

OPTION 3 - without Git

Download the latest source zip from Github and extract it into a new folder named CSS Format in your Sublime Text “Packages” folder.

Usage

Select the code, or place cursor in the document, and execute commands in one of the following ways:

  • Context Menu: CSS Format.

  • Edit Menu: Edit > CSS Format.

  • Command Panel: Open command panel: Ctrl+Shift+P (Linux/Windows) or Cmd+Shift+P (OS X) and select Format CSS: XXX.

Shortcuts

By default, CSS Format provides no keyboard shortcuts to avoid conflicts, but you can read the included Example.sublime-keymaps file to get an idea how to set up your own.

Configuration

There are a number of configuration options available to customize the behavior on save. For the latest information on what options are available, select the menu item Preferences > Package Settings > CSS Format > Settings - Default.

DO NOT edit the default settings. Your changes will be lost when CSS Format is updated. ALWAYS edit the user settings by selecting Preferences > Package Settings > CSS Format > Settings - User.

  • indentation: Format indentation, you can set it to " ". By default, this is set to "\t"

  • expand_block_break: Set the line breaks after each rules block under Expanded format. By default, this is set to "\n\n".

  • format_on_save: Set to true to trigger format on save. By default, this is set to false.

  • format_on_save_action: Format action. You can refer to Settings - Default. By default, this is set to "expand".

  • format_on_save_filter: CSS Format matches the name of the file being saved against this regular expression to determine if a build should be triggered. By default, the setting has a value of "\\.(css|sass|scss|less)$".

Author

Created by Mutian (http://mutian.wang).

For more info, you can send email to me: mutian(a)me.com!

Acknowledgements

For Chinese information, please visit http://mutian.wang/1508.